#ifndef ELK_PREVIEW_VIEW_H
#define ELK_PREVIEW_VIEW_H

#include <QWidget>
#include "elk_web_delegate.h"

namespace Ui {
class ElkPreviewView;
}

class ElkPreviewView : public QWidget
{
    Q_OBJECT

public:
    explicit ElkPreviewView(QWidget *parent = nullptr);
    ~ElkPreviewView();

    void bind(QWeakPointer<ElkWebDelegate> delegate);
    void display(const QString &frame, const QString &plainText);
    void displayPageSource(const QString &frame, const QString &source);

private slots:
    void onPageSourceVisited(const QString &frame, const QString &source);
    void onDisplayTextVisited(const QString &frame, const QString &text);

    void on_pushButtonClear_clicked();
    void on_pushButtonSave_clicked();

private:
    Ui::ElkPreviewView *ui;
    QWeakPointer<ElkWebDelegate> delegate_;
};

#endif // ELK_PREVIEW_VIEW_H
